package com.loper7.base.adapter;

import android.content.Context;
import android.view.ViewGroup;

import com.jude.easyrecyclerview.adapter.BaseViewHolder;
import com.loper7.base.R;

/**
 * @author loper7
 * @date 2017/4/21 16:02
 * @Description: ${todo}
 */
public class TEasyRecyclerAdapter<T> extends RecyclerArrayAdapter<T> {
    public TEasyRecyclerAdapter(Context context) {
        super(context);
    }

    @Override
    public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {
        return null;
    }

    public void setOnMoreShowListener(final OnMoreShowListener onMoreShowListener) {
        setMore(R.layout.view_more_show, new OnMoreListener() {
            @Override
            public void onMoreShow() {
                onMoreShowListener.onMoreShow();
            }

            @Override
            public void onMoreClick() {

            }
        });
    }

    public void setOnMoreClickListener(final OnMoreClickListener onMoreClickListener) {
        setMore(R.layout.view_more_click, new OnMoreListener() {
            @Override
            public void onMoreShow() {

            }

            @Override
            public void onMoreClick() {
                onMoreClickListener.onMoreClick();
            }
        });
    }

    /**
     * 设置没有更多数据
     */
    public void showNoMore() {
        setNoMore(R.layout.view_no_more);
    }

    public interface OnMoreShowListener {
        void onMoreShow();
    }

    public interface OnMoreClickListener {
        void onMoreClick();
    }
}
